/***********************************************
 This file is part of redia-lib-utils-ios
.
 
 Copyright (c) 2012, 2013 Redia A/S
 
 Redia-library-app-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 Redia-library-app-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-library-app-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */


#import <Foundation/Foundation.h>

#define SCREEN_SCALE ([UIScreen instancesRespondToSelector:@selector(scale)] ? [UIScreen mainScreen].scale : 1.0f)

typedef enum {
    IMAGE_URL_UTILS_RESIZE_MODE_CROP_EDGES,
    IMAGE_URL_UTILS_RESIZE_MODE_BOUNDING_BOX
} IMAGE_URL_UTILS_RESIZE_MODE;


@interface InfoGalleriImageUrlUtils : NSObject {
    NSString* wsApiKey;
}

@property (nonatomic, copy) NSString* wsApiKey;
@property (nonatomic) CGFloat screenScale;

//Get the singleton
+ (InfoGalleriImageUrlUtils*) instance;

+ (NSString*)getResizedImageUrl:(NSString*)url toWidth:(NSInteger)width toHeight:(NSInteger)height usingQuality:(NSInteger)quality;

+ (NSString*)getResizedImageUrl:(NSString*)url toWidth:(NSInteger)width toHeight:(NSInteger)height usingQuality:(NSInteger)quality withMode:(IMAGE_URL_UTILS_RESIZE_MODE)mode;

+ (NSString*)getResizedImageUrl:(NSString*)url toWidth:(NSInteger)width toHeight:(NSInteger)height usingQuality:(NSInteger)quality withMode:(IMAGE_URL_UTILS_RESIZE_MODE)mode outputFormat:(NSString*)output_format;

+ (NSString*)getResizedImageUrl:(NSString*)url toWidth:(NSInteger)width toHeight:(NSInteger)height usingQuality:(NSInteger)quality withMode:(IMAGE_URL_UTILS_RESIZE_MODE)mode outputFormat:(NSString*)output_format doubleUpForRetina:(BOOL)check_retina;

@end
